﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FullThrustLogic.Core.GameState
{
    public class CreateGameState : iGameState
    {
        private GameContext _gameContext;

        public event GameContext.GameStateChangedHandler OnGameStateChanged;
        public void AdvanceState()
        {
            if (OnGameStateChanged != null)
            {
                OnGameStateChanged(this, new EventArgs());
            }
        }

        public CreateGameState(GameContext gameContext)
        {
            _gameContext = gameContext;
        }

        public void CreateNewGame()
        {
            _gameContext.Map = new Map(30, 50);

            _gameContext.Players = new List<Player>();

            _gameContext.Players.Add(new Player(TypeOfPlayer.Player1));
            _gameContext.Players.Add(new Player(TypeOfPlayer.Player2));

            SenarioManager.SenarioManager.LoadTwoPlayerSenario(_gameContext);

            AdvanceState();
        }
    }
}
